* balance the treatment and control groups -------------------------------------

ebalance treatment recruitment_pool treatment_nonterror casualty_district       ///
kurdish_district akp_district higher_education min_margin turnout_jun,          ///
targets(1)

* run the regressions models and save them to memory ---------------------------

svyset [pweight= _webal]
eststo: svy: reg akp_nov treatment akp_jun
eststo: svy: reg akp_nov treatment treatment_multi akp_jun

* print the results ------------------------------------------------------------

esttab,                                                                         ///
replace se b(3) se(3) stats(N r2) wide label nodepvars nonotes nomtitles        ///
collabels("Coefficient" "Std. Error" "Coefficient" "Std. Error")                ///
order(treatment treatment_multi)                                                ///
title("Table S5: Regression models based on entropy balancing")

* save the results -------------------------------------------------------------

esttab using "./tables/table_s5.tex",                                           ///
replace se b(3) se(3) stats(N r2) wide label nodepvars nonotes nomtitles        ///
collabels("Coefficient" "Std. Error" "Coefficient" "Std. Error")                ///
order(treatment treatment_multi)                                                ///
title("Regression models based on entropy balancing")

* remove the entropy balancing weights -----------------------------------------

drop _webal

* remove the models from memory ------------------------------------------------

eststo clear